package com.wfx.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wfx.entity.WxbGoodsCat;
import com.wfx.service.IWxbGoodsCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>title: com.wfx.controller</p>
 * author zhuximing
 * description:
 */
@RestController
@RequestMapping("/goods/cat")
@CrossOrigin
public class GoodsCatController {

    @Autowired
    private IWxbGoodsCatService iWxbGoodsCatService;
    
    @RequestMapping("findByParent")
    public List<WxbGoodsCat> findByParent(String parentId){

        QueryWrapper<WxbGoodsCat> wrapper = new QueryWrapper<>();
        wrapper.eq("parent_id",parentId);

        return iWxbGoodsCatService.list(wrapper);
    }
        

}